﻿using Microsoft.AspNetCore.Authorization;

namespace Lightworks.Core.Auth
{
    public class AuthAttribute : AuthorizeAttribute, IAuthorizationRequirement, IAuthorizationRequirementData
    {
        public string? PermCode { get; }
        public AuthAttribute(string? code=null) => PermCode = code;

        public IEnumerable<IAuthorizationRequirement> GetRequirements()
        {
            yield return this;
        }
    }
}
 